-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add TCPC driver for RT1715 #81109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TCPC driver for RT1715 #81109
Conversation
84315d9 to
4cd7a1c
Compare
4cd7a1c to
8796eb8
Compare
8bacd7b to
5d3b6b4
Compare
drivers/usb_c/tcpc/rt1715.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you enabling both SOP' and SOP'' messages here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that both Numaker and STM32 enable them as well. However, I couldn't find the datasheet for the PS8xxx series, so I suspect that it may not support SOP'' messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PS8xxx does support SOP' and SOP''. However, the API documentation for tcpc_sop_prime_enable() indicates this command is used to enable SOP' messages, with no mention of SOP''.
The ChromeOS code that USB-C support is based on does enable SOP' and SOP'' for this command.
Do you mind updating the documentation for tcpc_sop_prime_enable() to note that this enables both SOP' and SOP''?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please review.
55c7eb8 to
a8bb603
Compare
drivers/usb_c/tcpc/rt1715.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PS8xxx does support SOP' and SOP''. However, the API documentation for tcpc_sop_prime_enable() indicates this command is used to enable SOP' messages, with no mention of SOP''.
The ChromeOS code that USB-C support is based on does enable SOP' and SOP'' for this command.
Do you mind updating the documentation for tcpc_sop_prime_enable() to note that this enables both SOP' and SOP''?
drivers/usb_c/tcpc/rt1715.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct. You're writing the TCPC register number into a pointer.
| buf[0].buf = TCPC_REG_RX_BUFFER; | |
| uint8_t tcpc_reg = TCPC_REG_RX_BUFFER; | |
| buf[0].buf = *tcpc_reg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my fault. fixed
a8bb603 to
6247177
Compare
keith-zephyr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. One last ask. Please add a build test that links in this driver.
See #83187 for an example.
Locally, you can run ./scripts/twister -ivc -s drivers.usb.build.i2c to verify the test.
1d00144 to
2356a95
Compare
Thanks for your review. |
#83187 has now merged. |
2356a95 to
77d80d3
Compare
Just updated. Local tests passed. |
drivers/usb_c/tcpc/ps8xxx.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking comment. This change isn't related to using the common tcpci functions.
Add generic functions that will be common to all TCPCI compliant drivers. Signed-off-by: Jianxiong Gu <[email protected]>
77d80d3 to
19be7e8
Compare
Add support for RT1715. Signed-off-by: Jianxiong Gu <[email protected]>
This commit modifies the ps8xxx.c driver to use the generic TCPCI function. Signed-off-by: Jianxiong Gu <[email protected]>
Clearly mention that this function enables both SOP' and SOP'' messages. Signed-off-by: Jianxiong Gu <[email protected]>
Add a build test to verify richtek,rt1715 driver builds correctly. Signed-off-by: Jianxiong Gu <[email protected]>
19be7e8 to
a717688
Compare
Add TCPCI functions and add driver for Richtek RT1715.